package com.yb.java.observer;

/**
 * @program: design-pattern
 * @description: 实体观察者类
 * @author: Mr.Bo
 * @create: 2021-04-27 23:21
 **/
public class BinaryObserver extends Observer {

    public BinaryObserver(Subject subject){
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println("Binary String:" + Integer.toBinaryString(subject.getState()));
    }
}
